Optimal. Leaf size=93 \[ -\frac {2 \sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {a+a \sin (c+d x)}}\right )}{d}+\frac {2 a \cos (c+d x)}{3 d \sqrt {a+a \sin (c+d x)}}+\frac {2 \cos (c+d x) \sqrt {a+a \sin (c+d x)}}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.22, antiderivative size = 93, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {2953, 3055,
3060, 2852, 212} \begin {gather*} \frac {2 \cos (c+d x) \sqrt {a \sin (c+d x)+a}}{3 d}+\frac {2 a \cos (c+d x)}{3 d \sqrt {a \sin (c+d x)+a}}-\frac {2 \sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {a \sin (c+d x)+a}}\right )}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 2852
Rule 2953
Rule 3055
Rule 3060
Rubi steps
\begin {align*} \int \cos (c+d x) \cot (c+d x) \sqrt {a+a \sin (c+d x)} \, dx &=\frac {\int \csc (c+d x) (a-a \sin (c+d x)) (a+a \sin (c+d x))^{3/2} \, dx}{a^2}\\ &=\frac {2 \cos (c+d x) \sqrt {a+a \sin (c+d x)}}{3 d}+\frac {2 \int \csc (c+d x) \sqrt {a+a \sin (c+d x)} \left (\frac {3 a^2}{2}-\frac {1}{2} a^2 \sin (c+d x)\right ) \, dx}{3 a^2}\\ &=\frac {2 a \cos (c+d x)}{3 d \sqrt {a+a \sin (c+d x)}}+\frac {2 \cos (c+d x) \sqrt {a+a \sin (c+d x)}}{3 d}+\int \csc (c+d x) \sqrt {a+a \sin (c+d x)} \, dx\\ &=\frac {2 a \cos (c+d x)}{3 d \sqrt {a+a \sin (c+d x)}}+\frac {2 \cos (c+d x) \sqrt {a+a \sin (c+d x)}}{3 d}-\frac {(2 a) \text {Subst}\left (\int \frac {1}{a-x^2} \, dx,x,\frac {a \cos (c+d x)}{\sqrt {a+a \sin (c+d x)}}\right )}{d}\\ &=-\frac {2 \sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {a+a \sin (c+d x)}}\right )}{d}+\frac {2 a \cos (c+d x)}{3 d \sqrt {a+a \sin (c+d x)}}+\frac {2 \cos (c+d x) \sqrt {a+a \sin (c+d x)}}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.15, size = 143, normalized size = 1.54 \begin {gather*} \frac {\sqrt {a (1+\sin (c+d x))} \left (3 \cos \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {3}{2} (c+d x)\right )-3 \log \left (1+\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+3 \log \left (1-\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-3 \sin \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {3}{2} (c+d x)\right )\right )}{3 d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 4.95, size = 103, normalized size = 1.11
method | result | size |
default | \(-\frac {2 \left (1+\sin \left (d x +c \right )\right ) \sqrt {-a \left (\sin \left (d x +c \right )-1\right )}\, \left (3 a^{\frac {3}{2}} \arctanh \left (\frac {\sqrt {a -a \sin \left (d x +c \right )}}{\sqrt {a}}\right )+\left (a -a \sin \left (d x +c \right )\right )^{\frac {3}{2}}-3 a \sqrt {a -a \sin \left (d x +c \right )}\right )}{3 a \cos \left (d x +c \right ) \sqrt {a +a \sin \left (d x +c \right )}\, d}\) | \(103\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 250 vs.
\(2 (79) = 158\).
time = 0.37, size = 250, normalized size = 2.69 \begin {gather*} \frac {3 \, \sqrt {a} {\left (\cos \left (d x + c\right ) + \sin \left (d x + c\right ) + 1\right )} \log \left (\frac {a \cos \left (d x + c\right )^{3} - 7 \, a \cos \left (d x + c\right )^{2} - 4 \, {\left (\cos \left (d x + c\right )^{2} + {\left (\cos \left (d x + c\right ) + 3\right )} \sin \left (d x + c\right ) - 2 \, \cos \left (d x + c\right ) - 3\right )} \sqrt {a \sin \left (d x + c\right ) + a} \sqrt {a} - 9 \, a \cos \left (d x + c\right ) + {\left (a \cos \left (d x + c\right )^{2} + 8 \, a \cos \left (d x + c\right ) - a\right )} \sin \left (d x + c\right ) - a}{\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2} + {\left (\cos \left (d x + c\right )^{2} - 1\right )} \sin \left (d x + c\right ) - \cos \left (d x + c\right ) - 1}\right ) + 4 \, {\left (\cos \left (d x + c\right )^{2} + {\left (\cos \left (d x + c\right ) - 1\right )} \sin \left (d x + c\right ) + 2 \, \cos \left (d x + c\right ) + 1\right )} \sqrt {a \sin \left (d x + c\right ) + a}}{6 \, {\left (d \cos \left (d x + c\right ) + d \sin \left (d x + c\right ) + d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {a \left (\sin {\left (c + d x \right )} + 1\right )} \cos ^{2}{\left (c + d x \right )} \csc {\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.45, size = 132, normalized size = 1.42 \begin {gather*} \frac {\sqrt {2} {\left (8 \, \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 3 \, \sqrt {2} \log \left (\frac {{\left | -2 \, \sqrt {2} + 4 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}}{{\left | 2 \, \sqrt {2} + 4 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}}\right ) \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) - 12 \, \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )} \sqrt {a}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\cos \left (c+d\,x\right )}^2\,\sqrt {a+a\,\sin \left (c+d\,x\right )}}{\sin \left (c+d\,x\right )} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________